<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>05BFC演示</title>

    <style>
        /* .box1{
            width: 188px;
            height: 188px;
            background-color: #bfa;
            float: left;
            overflow: hidden;
        }
        .box2{
            width: 188px;
            height: 188px;
            background-color: orange;
            overflow: hidden;

        }
        .box1-inner{
            width: 100px;
            height: 100px;background-color: blue;
            margin-top: 88px;
        } */

        .box1{
            width: 200px;
            height: 200px;
            background-color:#ccc;
            float: left;
            /* 已经相当于开启了BFC */
            /* 解决了父子元素外边距重叠问题 */

        }
        .box1::after{
            content: '1';
        }


        .box2{
            width: 200px;
            height: 200px;
            background-color: #bfa;
            /* 如果box2不开启BFC 则会被浮动元素所覆盖 */
            overflow: hidden;

            
        }
        .box3{
            width: 100px;
            height: 100px;
            background-color: orange;
            margin-top: 20px;
        }
        .box4{
            width: 20px;
            height: 20px;
            background-color: #bfa;
            margin-top: 15px;
        }

    </style>
</head>
<body>
    <!-- <div class="box1">
        <div class="box1-inner"></div>
    </div>

    <div class="box2"></div> -->



    <div class="box1">
        
        <div class="box3">3</div>
        <div class="box4">4</div>
    </div>
    <div class="box2">2</div>


    
</body>
</html>